#!/usr/bin/env python
#!/usr/bin/env python

import os
import readline
import sys

# This module allows us to spawn a python-like console
# with the full python interpreter accesible

import code

consola=code.InteractiveConsole()

# The console will have all uprgae function and variables
# as first class objects.  That means that instead of calling
# functions like this: uprgae.delete('fulano.sutano') we can
# only write: delete('fulano.sutano')
#

consola.push("from uprgae import *")

# Changes default python console prompt
sys.ps1="\n<[ GAE ]> "
consola.push('dom="\\n" + domain')
consola.push('sys.ps1=dom + sys.ps1')

# Print console header
consola.push("printheader()")


# Comment this next line is you do not want to be asked for login
# before starting console
#consola.push("login()")

consola.push('print')
consola.push('print "Use login() if you need to login again"')
consola.push('print "For a list of commands write commands()"')
consola.push('print "Use quit() or Ctrl-D (i.e. EOF) to exit"')

#consola.push('commands()')

# Opens UPR-GAE console
consola.interact("")
